<script setup lang="ts">
import { ref, defineProps } from 'vue'
const props = defineProps({
    checkedOptions: {
        type: Array,
        default: () => []
    },
    // v-model 双向绑定
    modelValue: {
        type: Array,
    },
    // 是否禁用
    disabled:{
        type:Boolean,
        default:false
    }
})
const emit = defineEmits(['update:modelValue'])
const checkedList = ref(props.modelValue)
</script>

<template>
    <div>
        <el-checkbox-group v-model="checkedList" @change="emit('update:modelValue', checkedList)">
            <el-checkbox v-for="(i, index) in props.checkedOptions" :key="index" :label="i.label">
            </el-checkbox>
        </el-checkbox-group>

    </div>
</template>

<style scoped></style>